function out = smoothers2020(data, varargin)

timer = tic;

switch varargin{1}
    case 'time'
       %% time smooth
        if length(varargin) == 1
            windowSize = 1;
        else
            windowSize = varargin{2};
        end
        a = 1;
        b = (1./windowSize).*ones(1,windowSize);

        out = data;
%        H = waitbar(0,'Starting...');
        if length(size(data)) == 3
            textprogressbar('new', 'Smoothing in time:      ');
            for row = 1:size(data, 1)
                for col = 1:size(data, 2)
                    out(row, col, :) = ...
                        filter(b, a, squeeze(data(row, col, :)));
                end
                textprogressbar('update', row/size(data, 1)*100);
            end
            out(:, :, 1) = out(:, :, 2);
            textprogressbar('done', ' done!')
            fprintf('Time smoothing took %3.2g seconds.\n',toc(timer)); % how long computation took
    %        close(H); % kill loading bar
        elseif length(size(data)) == 2
            out = filter(b, a, data);
        else
            disp('fuck')
        end

    case 'space'
        disp('Space smoothing...');

        %% space smooth

        if length(varargin) >= 3
            r = varargin{2};
            sigma = varargin{3};
        else
            r = 3;
            sigma = 3;
        end
        spatialFilter = fspecial('gaussian', [r r], sigma);

        out = imfilter(data, spatialFilter, 'replicate');
        fprintf('Space smoothing took %3.2g seconds.\n',toc(timer)); % how long computation took
    otherwise
        disp('not acceptable smoother')
end

end